<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <link rel="stylesheet" type="text/css" href="../static/css/login.css"/>
    <script src="../static/js/register.js" type="text/javascript"></script>

</head>
<body>

<div class="login-box">
    <h2>入口</h2>
    <!-- flash消息展示-->
        {% for message in get_flashed_messages() %}
        <div class="alert alert-warning" >
            <p style="color: red;">{{ message }}</p>
        </div>
        {% endfor %}
    <form action="{{ url_for('login.login') }}" method="post">
    {{ form.csrf_token }} <!-- 渲染CSRF令牌隐藏字段 -->
        <table >
            <tbody>
            <!--用户名  -->
            <tr class="login-field">
                <td >{{ form.username.label }}</td>
                <td>{{ form.username }}</td>
                <!--jinja2的函数-->
                <td>{% for err in form.username.errors %}
                    {{ err }}
                    {% endfor %}
                </td>
            </tr>
            <!--密码  -->
            <tr class="login-field">
                <td >{{ form.password.label }}</td>
                <td>{{ form.password }}</td>
                <td>{% for err in form.password.errors %}
                    {{ err }}
                    {% endfor %}
                </td>
            </tr>
            <!--提交  -->
            <tr id="myloginlabel">
                <td >{{ form.submit }}</td>
            </tr>
            <!--注册  -->
            <tr>
                <td>
                    <p style="color: #101113">没有账号？<a href="{{ url_for('login.register') }}" style="color: rgba(22,180,166,0.58)" onclick="topggleForm();">注册</a></p>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</body>
</html>